﻿
Partial Class mtUsersFCListPopup
    Inherits System.Web.UI.Page
    Public ScriptText As String
    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        If Session("users") Is Nothing Then
            ScriptText = "<script> window.parent.TINY.box.hide();</script>"
        End If
        If IsPostBack = False Then
            ' UID=' + id +"&UFC="+ ufc +"&IDYear"+ idyear +"&FCFrom" + from + "&FCTo" 
            Dim Code = Request("Fcode").Split(",")
            Dim cfrom As String = Code(0)
            Dim cto As String = Code(1)
            Session("cfrom") = cfrom
            Session("cto") = cto
            'Response.Write(Request("Fcode"))
            L_FundCenter.Text = "รายการ Fund Center จาก " & cfrom & " ถึง " & cto

            'Dim adapter As New MasterDataSetTableAdapters.FundCentersTableAdapter
            'Dim data As New MasterDataSet.FundCentersDataTable
            'data = adapter.GetDataByCodeFrom_CodeTo(cfrom, cto, Val(Request("IDYear"))) '"0010", "0020", 2557) 
            'GridView1.DataSource = data
            'GridView1.DataBind()

        End If
    End Sub
    Protected Sub WebGrid1_InitializeDataSource(ByVal sender As Object, ByVal e As ISNet.WebUI.WebGrid.DataSourceEventArgs) Handles WebGrid1.InitializeDataSource

        Dim adapter As New MasterDataSetTableAdapters.FundCentersTableAdapter
        Dim data As New MasterDataSet.FundCentersDataTable
        '  data = adapter.GetDataByCodeFrom_CodeTo(cfrom, cto, Val(Request("IDYear"))) '"0010", "0020", 2557) 

        Session("count_data") = data.Rows.Count
        'Response.Write(Session("cfrom") & "/" & Session("cto") & "/" & Val(Request("IDYear")))
        e.DataSource = adapter.GetDataByCodeFrom_CodeTo(Session("cfrom"), Session("cto"), Val(Request("IDYear"))) '"0010", "0020", 2557) 

    End Sub

    Protected Sub WebGrid1_InitializeRow(ByVal sender As Object, ByVal e As ISNet.WebUI.WebGrid.RowEventArgs)
        ' don't edit column
        e.Row.Cells(0).ForceNoEdit = True
        e.Row.Cells(1).ForceNoEdit = True
    End Sub
End Class
